//    Copyright (C) Kherty.  All rights reserved.
#region

using System;
using OpenLS.Core.Serialization;

#endregion

namespace OpenLS.Vml
{
    internal class TextPath : ShapeElement
    {
        private string _string;
        private string _Style;
        private bool? fitpath;
        private bool? fitshape;
        private string id;
        private bool? on;
        private bool? trim;
        private bool? xscale;

        internal override void ReadXmlCore(ReadContext context)
        {
            using
                (var c = context.Read("textpath"))
            {
                id = c.GetOptionalString("id");
                _Style = c.GetOptionalString("style");
                on = c.GetOptionalBoolean("on");
                fitshape = c.GetOptionalBoolean("fitshape");
                fitpath = c.GetOptionalBoolean("fitpath");
                trim = c.GetOptionalBoolean("trim");
                xscale = c.GetOptionalBoolean("xscale");
                _string = c.GetOptionalString("string")
                    ;
            }
        }

        internal override void WriteXmlCore(WriteContext context)
        {
            using
                (var c = context.Write("textpath"))
            {
                c.SetOptionalString("id", id);
                c.SetOptionalString("style", _Style);
                c.SetOptionalBoolean("on", on);
                c.SetOptionalBoolean("fitshape", fitshape);
                c.SetOptionalBoolean("fitpath", fitpath);
                c.SetOptionalBoolean("trim", trim);
                c.SetOptionalBoolean("xscale", xscale);
                c.SetOptionalString("string", _string);
            }
        }
    }
}